//
//  JEHDataBaseHandle.h
//  SinaNews
//
//  Created by 蒋恩浩 on 15/12/10.
//  Copyright © 2015年 JEH. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "JEHCollectionModel.h"

@interface JEHDataBaseHandle : NSObject

@property (nonatomic, retain) NSMutableArray *nameArray;
@property (nonatomic, retain) NSMutableArray *urlArray;
@property (nonatomic, retain) NSMutableArray *numberArray;
@property (nonatomic, retain) NSMutableArray *memoryArray;

+ (instancetype)shareDataBaseHandle;
- (void)createTable;
- (void)openDataBase;
- (void)closeDataBase;
- (void)insertIntoDataBase:(JEHCollectionModel *)rootModel;
- (NSArray *)selectAllFromDataBase;
- (JEHCollectionModel *)selectWithTitle:(NSString *)title;
- (void)deleteFromDataBase:(NSString *)title;

- (void)createTitleArrayTable;
- (void)insertTitleArrayIntoDataBase:(NSString *)name withUrl:(NSString *)url;
- (void)selectTitleArrayAllFromDataBase;
- (void)deleteTitleArrayFromDataBase:(NSString *)name;
- (BOOL)selectWithName:(NSString *)name;

- (void)createUserLoginTable;
- (void)insertUserLoginIntoDataBase:(NSString *)name withUrl:(NSString *)url;
- (void)selectUserLoginAllFromDataBase;
- (void)deleteUserLoginFromDataBase:(NSString *)name;

@end
